home *** CD-ROM | disk | FTP | other *** search
- property status, animChannel, introFrames, mainFrames, outroFrames, staticCastPos, castOffset, buttonChannel, commandString, clicked, clickSound, ROsound, resetFlag, soundStatus, soundWait
- global gRollAnimButton, gActorList, gSceneObject, gSimObject, gVTLobject, gVTLgameObject, g3DObject, gQTViewerObject, gAwardsObject, gHardHatObject, gAlbumObject, gLoopGroupObject, gCustomCursor
-
- on birth me, command, buttonChannelNum, animChannelNum, main, soundA, soundB, intro, outro
- set status to #static
- set clicked to 0
- set soundWait to 1
- set mainFrames to main
- set soundStatus to #off
- set clickSound to soundA
- set ROsound to soundB
- if voidp(intro) then
- set introFrames to 0
- else
- set introFrames to intro
- end if
- if voidp(outro) then
- set outroFrames to 0
- else
- set outroFrames to outro
- end if
- set animChannel to animChannelNum
- set buttonChannel to buttonChannelNum
- set staticCastPos to the castNum of sprite animChannel
- set castOffset to 0
- set commandString to command
- set resetFlag to 1
- preLoadCast(staticCastPos + 1, staticCastPos + introFrames + mainFrames + outroFrames)
- return me
- end
-
- on update me
- if status = #static then
- if rollOver(buttonChannel) and not soundBusy(1) then
- hideCustomCursor(me)
- set gRollAnimButton to me
- hideOtherActors(gRollAnimButton)
- puppetSprite(animChannel, 1)
- if ROsound <> EMPTY then
- puppetSound(ROsound)
- set soundStatus to #ROsoundOn
- end if
- if introFrames = 0 then
- set status to #main
- else
- set status to #intro
- end if
- set castOffset to 1
- replaceBitmap(me)
- else
- exit
- end if
- else
- if status = #intro then
- processSound(me)
- set castOffset to castOffset + 1
- if castOffset > introFrames then
- set status to #main
- end if
- replaceBitmap(me)
- else
- if status = #main then
- processSound(me)
- if castOffset = (introFrames + mainFrames) then
- if not clicked and (rollOver(buttonChannel) = 1) then
- set castOffset to introFrames + 1
- replaceBitmap(me)
- else
- if outroFrames = 0 then
- if the castNum of sprite animChannel = (staticCastPos + 1) then
- set status to #done
- else
- set the castNum of sprite animChannel to staticCastPos + 1
- exit
- end if
- else
- set status to #outro
- set castOffset to introFrames + 1
- replaceBitmap(me)
- end if
- end if
- else
- set castOffset to castOffset + 1
- replaceBitmap(me)
- end if
- else
- if status = #outro then
- processSound(me)
- if castOffset = 0 then
- set status to #done
- else
- if castOffset = (introFrames + 1) then
- set castOffset to introFrames + mainFrames + 1
- else
- if castOffset = (introFrames + mainFrames + outroFrames) then
- set castOffset to 0
- else
- set castOffset to castOffset + 1
- end if
- end if
- replaceBitmap(me)
- end if
- else
- if status = #done then
- if soundStatus = #ROsoundOn then
- repeat while soundBusy(1)
- end repeat
- if clicked then
- playClickSound(me)
- updateStage()
- end if
- end if
- if clicked = 1 then
- if soundWait and (soundStatus <> #clickSoundDone) then
- repeat while soundBusy(1)
- end repeat
- end if
- set clicked to 0
- if soundWait then
- puppetSound(0)
- end if
- do(commandString)
- if soundWait = 0 then
- repeat while soundBusy(1)
- if objectp(gCustomCursor) then
- update(gCustomCursor)
- updateStage()
- end if
- end repeat
- puppetSound(0)
- end if
- else
- puppetSound(0)
- showAllActors()
- end if
- reset(me)
- if resetFlag then
- resetBitmap(me)
- end if
- if objectp(gLoopGroupObject) then
- waitOneFrame(gLoopGroupObject)
- end if
- end if
- end if
- end if
- end if
- end if
- end
-
- on processSound me
- if soundStatus = #off then
- playClickSound(me)
- else
- if soundStatus = #ROsoundOn then
- if not soundBusy(1) then
- set soundStatus to #off
- end if
- else
- if soundStatus = #clickSoundOn then
- if not soundBusy(1) then
- set soundStatus to #clickSoundDone
- end if
- end if
- end if
- end if
- end
-
- on playClickSound me
- if clicked and (clickSound <> EMPTY) then
- puppetSound(clickSound)
- set soundStatus to #clickSoundOn
- end if
- end
-
- on hideCustomCursor me
- cursor(-1)
- removeSprite(48)
- end
-
- on click me
- if (buttonChannel = the clickOn) and (clicked = 0) then
- set clicked to 1
- end if
- end
-
- on replaceBitmap me
- set the castNum of sprite animChannel to staticCastPos + castOffset
- set resetFlag to 1
- end
-
- on select me
- set the castNum of sprite animChannel to staticCastPos - 1
- set resetFlag to 0
- end
-
- on reset me
- set status to #static
- set soundStatus to #off
- set castOffset to 0
- set gRollAnimButton to EMPTY
- end
-
- on resetBitmap me
- set the castNum of sprite animChannel to staticCastPos
- end
-
- on makeButtonJump me
- set jumpBase to staticCastPos + 6
- repeat with offset = 0 to 8
- set the castNum of sprite animChannel to jumpBase + offset
- updateStage()
- startTimer()
- repeat while the timer < 3
- end repeat
- end repeat
- removeSprite(animChannel)
- updateStage()
- end
-